import dayjs from "dayjs";
export class songDetail {
  constructor(songs) {
    this.id = songs.id;
    this.name = songs.name;
    this.alia = songs.alia.length !== 0 ? songs.alia[0] : "";
    this.album = songs.al.name;
    this.song = songs.ar[0].name;
    this.song2 = songs.ar.length >= 2 ? songs.ar[1].name : "";
    this.song3 = songs.ar.length >= 3 ? songs.ar[2].name : "";
    this.song4 = songs.ar.length >= 4 ? songs.ar[3].name : "";
    this.aliasId = songs.ar[0].id;
    this.aliasId2 = songs.ar.length >= 2 ? songs.ar[1].id : "";
    this.aliasId3 = songs.ar.length >= 3 ? songs.ar[2].id : "";
    this.aliasId4 = songs.ar.length >= 4 ? songs.ar[3].id : "";
    this.pic = songs.al.picUrl;
    this.mv = songs.mv;
    // this.musicId= privileges[0].id;
    this.albumId = songs.al.id;
    this.time = dayjs(songs.dt).format("mm:ss");
  }
}
export class rankSongDetail {
  constructor(songs) {
    this.id = songs.id;
    this.name = songs.name;
    this.alia = songs.alia.length !== 0 ? songs.alia[0] : "";
    this.album = songs.al.name;
    this.song = songs.ar[0].name;
    this.song2 = songs.ar.length >= 2 ? songs.ar[1].name : "";
    this.song3 = songs.ar.length >= 3 ? songs.ar[2].name : "";
    this.song4 = songs.ar.length >= 4 ? songs.ar[3].name : "";
    this.aliasId = songs.ar[0].id;
    this.aliasId2 = songs.ar.length >= 2 ? songs.ar[1].id : "";
    this.aliasId3 = songs.ar.length >= 3 ? songs.ar[2].id : "";
    this.aliasId4 = songs.ar.length >= 4 ? songs.ar[3].id : "";
    this.pic = songs.al.picUrl;
    this.mv = songs.mv;
    // this.musicId= privileges[0].id;
    this.albumId = songs.al.id;
    this.time = dayjs(songs.dt).format("mm:ss");
  }
}
